import request from "../../utils/request";

const getPage = params => request({
  url: `v1/project/needs/${params.id}/page`,
  method: 'get',
  params: params
});

const create = (data) => request({
  url: 'v1/project/needs',
  method: 'post',
  data: data
});
const getByid = (params) => request({
  url: `v1/project/needs/${params.id}`,
  method: 'get',
  data: params
});
//
const update = (data) => request({
  url: `v1/project/needs/${data.Id}`,
  method: 'put',
  data: data
});
//
const deleteById = (data) => request({
  url: `v1/project/needs/${data.Id}`,
  method: 'delete',
  data: data
});
//
const toPlanById = (data) => request({
  url: `v1/project/needs/changed/${data.Id}/plan`,
  method: 'put',
  data: data
});

export default {
  getPage,
  create,
  getByid,
  update,
  deleteById,
  toPlanById
}
